Skip to main content

Contract Functions

Referral Storage​

registerCode​

Public function for setting the user's referral code.

function registerCode(string memory _code)

configure​

Admin function to set the config for step reduction and discount on the basis of tier

function configure(
uint8[3] calldata _referrerTierStep,
uint32[3] calldata _referrerTierDiscount // Factor of 1e5
)

setReferrerTier​

Admin function to set referrer's tier

function setReferrerTier(address _referrer, uint8 tier)

Option Router​

revokeApprovals​

function revokeApprovals(RevokeParams[] memory revokeParams) 

openTrades​

Function for keepers to open the queued trades

function openTrades(OpenTxn[] calldata params)

executeOptions​

Function for keepers to close the expired trades

function executeOptions(CloseTradeParams[] calldata optionData)

closeAnytime​

Function for keepers to close when requested by user

function closeAnytime(CloseAnytimeParams[] memory closeParams) external

setContractRegistry​

Admin function to set/unset the asset pairs for trading

function setContractRegistry(address targetContract, bool register)

setKeeper​

Admin function to set/unset keepers

function setKeeper(address _keeper, bool _isActive)

Liquidity Pool​

setHandler​

Admin function to set handlers

function setHandler(address _handler, bool _isActive)

setMaxLiquidity​

Admin function to set max liquidity

function setMaxLiquidity(uint256 _maxLiquidity)

Provide​

Public function to add liquidity

function provide(uint256 tokenXAmount, uint256 minMint)

provideForAccount​

Handler only function to add liquidity for an account

function provideForAccount(
uint256 tokenXAmount,
uint256 minMint,
address account
)

Withdraw​

Public function to remove liquidity

function withdraw(uint256 tokenXAmount) 

withdrawForAccount​

Handler only function to remove liquidity for an account

function withdrawForAccount(uint256 tokenXAmount, address account)

toTokenX​

Returns tokenX equivalent of a certain amount BLP

function toTokenX(uint256 amount)

getUnlockedLiquidity​

Returns available liquidity

function getUnlockedLiquidity(address account)

shareOf​

Returns provider's share in tokenX

function shareOf(address account)

availableBalance​

Returns the amount of tokenX available for withdrawals

function availableBalance()

totalTokenXBalance​

Returns the total balance of tokenX provided to the pool

function totalTokenXBalance()

Buffer Options​

setIsPaused​

Admin only function to pause/Unpause the option creation

function setIsPaused()

fees​

Returns the fees for buying an option

function fees(
uint256 amount,
address user,
string calldata referralCode,
uint256 baseSettlementFeePercentage
)

isStrikeValid​

Returns true if the strike price at which the trade is opened lies within the slippage bounds

function isStrikeValid(
uint256 slippage,
uint256 strike,
uint256 expectedStrike
)

getMaxTradeSize​

 function getMaxTradeSize() public view returns (uint256) 

getMaxOI​

 function getMaxOI() public view returns (uint256) 

getSettlementFeePercentage​

function getSettlementFeePercentage(
address referrer,
address user,
uint256 baseSettlementFeePercentage
) public view returns (uint256 settlementFeePercentage)